﻿<local:DocumentBase x:Class="WPFExcelReport.YGRABDOC"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"       
                    xmlns:me="clr-namespace:WPFExcelReport;assembly=YGRONAV95"
                     xmlns:GD="clr-namespace:WPFExcelReport;assembly=TGAAUF" 
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS" 
                    xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND"                     
                    FontSize="16"
                     Name="TV"
                    Loaded="Window_Loaded"
>
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:UpperConverter x:Key="upper"/>
        <ucd:Divideby10M  x:Key="d10m"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:UPPERGB2312 x:Key="UGB"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetDetail" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <db:SETINTEXDB  x:Key="SetStock" />
        <CollectionViewSource   x:Key="vwABKOPF" Source="{Binding Path=ABKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwXABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwXZUTEI" Source="{Binding Path=ZUTEI,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwXGAAUF" Source="{Binding Path=GAAUF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwYARNA" Source="{Binding Path=GAAUF,Source={StaticResource SetStock}}" />
        <CollectionViewSource   x:Key="vwGLLG" Source="{Binding Path=GLLG,Source={StaticResource SetStock}}" />
        <CollectionViewSource   x:Key="vwABAX" Source="{Binding Path=ICC_ABAX,Source={StaticResource SetStock}}" />
        <CollectionViewSource   x:Key="vwMGAAUF" Source="{Binding Path=GAAUF,Source={StaticResource SetData}}"/>
        <CollectionViewSource   x:Key="vwYGAAUF" Source="{Binding Path=GAAUF,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwTABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwGAAUF" Source="{Binding Path=GAAUF,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwZUTEI" Source="{Binding Path=ZUTEI,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwZUTEIEXT" Source="{Binding Path=ZUTEI_EXT,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwARANS" Source="{Binding Path=ARANS,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwLRPOS" Source="{Binding Path=LRPOS,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwABFOLGE" Source="{Binding Path=ABFOLGE,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwMU" Source="{Binding Path=ICC_ABAX,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwTABAX" Source="{Binding Path=ICC_ABAX,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwABAUFM" Source="{Binding Path=ABAUFM,Source={StaticResource SetDetail}}" />
    </local:DocumentBase.Resources>
    <TabControl>
        <TabItem Header="混棉管理">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*" ></RowDefinition>
                    <RowDefinition Height="2*" ></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,2,0,0">
                    <WrapPanel Name="ZoneOrder">
                        <TextBlock Width="Auto">生产单:</TextBlock>
                        <TextBox   Name="txtAUFKRS" MaxLength="2" Width="40" FontSize="16" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper" TabIndex="11" />
                        <TextBox   Name="txtAUFLFD" MaxLength="6" Width="80" FontSize="16" Margin="0,0,0,0"  HorizontalAlignment="Left" KeyUp="txtAUFLFD_KeyUp" />
                        <TextBox   Name="txtAUFPOS" MaxLength="6" Width="40" FontSize="16" Margin="0,0,0,0" Text="{Binding Path=ABPAUFPOS,  Source={StaticResource ResourceKey=vwABPOS}}"  HorizontalAlignment="Left" />
                        <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock FontSize="18"    Width="Auto"  Margin="0,0,0,0" Text="查询" />
                        <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnGotoCombine_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Convert.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock FontSize="18"    Width="Auto"  Margin="0,0,0,0" Text="合投"/>

                        <Grid IsEnabled="{Binding IsCanChgGAAUF,ElementName=TV}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0"  Width="30" Height="30" Margin="10,0,0,0"  Click="btnToAllocation_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Convert.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1"  FontSize="18" Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="留位"   VerticalAlignment="Center"/>
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0"  Width="30" Height="30" Margin="10,0,0,0"  Click="btnRepaire_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Redo.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1" Name="txtRepaire" FontSize="18" Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="回修"   VerticalAlignment="Center"/>
                        </Grid>
                        <WF:TBTNEXE DLL="TABAUFM" CMD="HFAB50GB12" STWNW="MainWindow" INFO="历史打印" IsInfo="True"/>
                        <Button Content="分磅清单"  FontSize="18"  Height="Auto" Margin="10,0,0,0" Width="Auto" Click="btnPrintBatches_Click"   VerticalAlignment="Center"/>
                    </WrapPanel>
                    <WrapPanel>
                        <Grid  Margin="0,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"   Margin="0,0,0,0" Text="订单kg"  VerticalAlignment="Center"/>
                            <TextBlock  Grid.Column="1"   Height="Auto"   Width="60"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                               Text="{Binding Path=ABPSOLLMENGE7, Source={StaticResource ResourceKey=vwABPOS},Converter={StaticResource ResourceKey=d100}}" />
                            <TextBlock Grid.Column="2"   Margin="0,0,0,0" Text="现:"  VerticalAlignment="Center"/>
                            <TextBlock  Grid.Column="3"  Foreground="Red"  Height="Auto"   Width="60"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                        Name="cVKPQty"
                                                 />
                        </Grid>
                        <Grid  Margin="0,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="粗纱kg"  VerticalAlignment="Center"/>
                            <TextBlock  Grid.Column="1" Background="White"   Height="Auto"   Width="80"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                               Text="{Binding Path=ABPSOLLMENGE5, Source={StaticResource ResourceKey=vwABPOS},Converter={StaticResource ResourceKey=d100}}" />
                        </Grid>
                        <Grid Margin="20,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"   Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="以订单量为基础的分离kg"  VerticalAlignment="Center" />
                            <TextBox Grid.Column="1" Background="White" Height="Auto"  FontSize="16"  Width="80" Name="txtSplitQty"   Margin="0,0,0,0" Text=""   VerticalAlignment="Center"/>
                        </Grid>
                        <Grid Margin="20,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button  Grid.Column="0" Height="30"  Width="30" Margin="10,0,0,0"   Click="btnSplitBatch_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Convert.png" />

                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1" FontSize="18"    Width="Auto"  Margin="0,0,0,0" Text="拆分"/>
                            <TextBox Grid.Column="2" FontSize="18"    Width="20"  Margin="0,0,0,0" Text="N" Name="txtFlagSplit"/>
                            <TextBox Grid.Column="3" FontSize="18"    Width="Auto"  Margin="0,0,0,0" Text="000" Name="txtPOS1"/>
                        </Grid>
                    </WrapPanel>
                    <WrapPanel>
                        <Grid  Margin="0,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" FontSize="18" Height="Auto"   Width="Auto"  Margin="0,0,0,0" Content="更新粗纱" Click="btnUpdateHMABPART_Click"  VerticalAlignment="Center"/>
                            <TextBox Grid.Column="1" FontSize="18"    Width="20"  Margin="0,0,0,0" Text="N" Name="txtFlagABPART"/>
                            <TextBox  Grid.Column="2" Background="White" MaxLength="20" FontSize="16"  Height="Auto"   Width="Auto"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                               Text="{Binding Path=ABPART, Source={StaticResource ResourceKey=vwABPOS}}" />
                            <TextBox  Grid.Column="3" Background="White" MaxLength="3" FontSize="16"  Height="Auto"   Width="Auto"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                               Text="{Binding Path=ABPVAR, Source={StaticResource ResourceKey=vwABPOS}}" />
                            <TextBox  Grid.Column="4" Background="White" MaxLength="10"  FontSize="16" Height="Auto"   Width="Auto"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                               Text="{Binding Path=ABPFARBE, Source={StaticResource ResourceKey=vwABPOS}}" />
                        </Grid>
                    </WrapPanel>
                </StackPanel>
                <DataGrid Grid.Row="1"  Grid.Column="0"   Margin="0,0,0,0" 
                          FontSize="12"
                          Name="dlgMaster"
                          CanUserReorderColumns="True"  
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS}}" 
                  >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="" Binding="{Binding ABPAUFKRS}" Width="Auto"/>
                        <DataGridTextColumn Header="生产单" Binding="{Binding ABPAUFLFD}" Width="Auto"/>
                        <DataGridTextColumn Header="" Binding="{Binding ABPAUFPOS}" Width="Auto"/>
                        <DataGridTextColumn Header="纱线" Binding="{Binding ABPART}" Width="Auto"/>
                        <DataGridTextColumn Header="版本" Binding="{Binding ABPVAR}" Width="Auto"/>
                        <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE}" Width="Auto"/>
                        <DataGridTextColumn Header="KG" Binding="{Binding Path=ABPSOLLMENGE5, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="开始" Binding="{Binding ABPSTARTDAT}" Width="Auto"/>
                        <DataGridTextColumn Header="交期" Binding="{Binding ABPENDDAT}" Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
                <DataGrid Grid.Row="1" Grid.Column="1" Margin="0,0,0,0" 
                              FontSize="12"
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwGAAUF}}"  x:Name="dlgABP" 
                              >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="ID" Binding="{Binding GAPOS}" Width="Auto"/>
                        <DataGridTextColumn Header="类型" Binding="{Binding GAAUFMSL}" Width="Auto"/>
                        <DataGridTextColumn Header="纱线" Binding="{Binding GAART, Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                        <DataGridTextColumn Header="版本" Binding="{Binding GAURVAR}" Width="Auto"/>
                        <DataGridTextColumn Header="版本" Binding="{Binding GAVAR}" Width="Auto"/>
                        <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE, Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                        <DataGridTextColumn Header="批次" Binding="{Binding Path=GABEM, Converter={StaticResource ResourceKey=Trim}}" Width="Auto"/>
                        <DataGridTextColumn Header="比例" Binding="{Binding Path=GASP1, Converter={StaticResource ResourceKey=d1000}}" Width="Auto"/>
                        <DataGridTextColumn Header="需求" Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="预留" Binding="{Binding Path=GAKG2, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="总仓" Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="车间" Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="开始" Binding="{Binding GADATBIS}" Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
                <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,20,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*" />
                        <RowDefinition Height="1*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0" Grid.Row="0" Grid.RowSpan="2">
                        <TXT:TXTITX Margin="0,5,0,0" Name="cTxt" 
                                IsAuto="True"
                                IsInfoOneLine="True"
                                TART="ABP"
                                SIND="{Binding TXTISIND,ElementName=TV}"  
                                />
                    </Grid>
                    <Grid Grid.Row="0" Grid.Column="1"  >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="1*" />
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0">
                            <WrapPanel>
                                <Button FontSize="18" Width="20" Height="20" Margin="10,0,0,0"  Name="btnInitializedMU"  Click="btnInitializedMU_Click">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                                    </Button.Background>
                                </Button>
                                <TextBlock  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="初始化"   VerticalAlignment="Center"/>
                                <Button FontSize="18" Width="20" Height="20" Margin="10,0,0,0" Name="btnRemoveBatch"    Click="btnRemoveBatch_Click">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/ImagePackage;component/Images/delete.png" />
                                    </Button.Background>
                                </Button>

                                <TextBlock  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="删除"   VerticalAlignment="Center"/>
                                <Button FontSize="18" Width="20" Height="20" Margin="10,0,0,0" Name="btnRemoveMU"    Click="btnRemoveMU_Click">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/ImagePackage;component/Images/delete.png" />
                                    </Button.Background>
                                </Button>
                                <TextBlock  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="根除"   VerticalAlignment="Center"/>
                                <Grid Margin="20,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0"   Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="批量"  VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1" Background="White" Height="Auto" FontSize="18"    Width="80" Name="txtBatchQty"   Margin="0,0,0,0" Text=""   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" FontSize="18" Width="20" Height="20" Margin="10,0,0,0"  Name="btnAddBatch" Click="btnAddBatch_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />

                                        </Button.Background>
                                    </Button>
                                    <TextBlock Grid.Column="1"  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="增批"   VerticalAlignment="Center"/>
                                </Grid>
                            </WrapPanel>
                        </StackPanel>
                        <Grid Grid.Row="1">
                            <DataGrid Margin="0,0,0,0" 
                              FontSize="12" 
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                              VerticalScrollBarVisibility="Auto"
                              RowDetailsVisibilityMode="VisibleWhenSelected"  VerticalAlignment="Top"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwZUTEIEXT}}"  
                              Name="dlgZUTEIEXT" >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Header="" Binding="{Binding ZUAUFKRS}" Width="Auto"/>
                                    <DataGridTextColumn Header="生产单" Binding="{Binding ZUAUFLFD}" Width="Auto"/>
                                    <DataGridTextColumn Header="" Binding="{Binding ZUAUFPOS}" Width="Auto"/>
                                    <DataGridTextColumn Header="类型" Binding="{Binding ZUSA}" Width="Auto"/>
                                    <DataGridTextColumn Header="批次" Binding="{Binding ZUSPPART,Converter={StaticResource ResourceKey=gb2312}}"  Width="Auto"/>
                                    <DataGridTextColumn Header="品种" Binding="{Binding ZUART}" Width="Auto"/>
                                    <DataGridTextColumn Header="版本" Binding="{Binding ZUVAR}" Width="Auto"/>
                                    <DataGridTextColumn Header="色号" Binding="{Binding ZUFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                                    <DataGridTextColumn Header="单元" Binding="{Binding ZULBEHI}" Width="Auto"/>
                                    <DataGridTextColumn Header="KG" Binding="{Binding Path=ZUEINTKG, Converter={StaticResource ResourceKey=d1000}}" Width="Auto"/>
                                </DataGrid.Columns>
                            </DataGrid  >
                            <DataGrid Margin="0,0,0,0" 
                              FontSize="12"  
            CanUserReorderColumns="True"  
                  CanUserResizeRows="True" CanUserSortColumns="True"                  
                  AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                  IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Collapsed"
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwZUTEI}}"  
                              Name="dlgZUTEI"
                  >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Header="" Binding="{Binding ZUAUFKRS}" Width="Auto"/>
                                    <DataGridTextColumn Header="生产单" Binding="{Binding ZUAUFLFD}" Width="Auto"/>
                                    <DataGridTextColumn Header="" Binding="{Binding ZUAUFPOS}" Width="Auto"/>
                                    <DataGridTextColumn Header="类型" Binding="{Binding ZUSA}" Width="Auto"/>
                                    <!--DataGridTextColumn Header="纺批" Binding="{Binding ZUSPPART,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                            <DataGridTextColumn Header="染批" Binding="{Binding GPFBPART,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/-->
                                    <DataGridTextColumn Header="品种" Binding="{Binding ZUART}" Width="Auto"/>
                                    <DataGridTextColumn Header="版本" Binding="{Binding ZUVAR}" Width="Auto"/>
                                    <DataGridTextColumn Header="色号" Binding="{Binding ZUFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                                    <DataGridTextColumn Header="单元" Binding="{Binding ZULBEHI}" Width="Auto"/>
                                    <DataGridTextColumn Header="留位量" Binding="{Binding Path=ZUEINTKG, Converter={StaticResource ResourceKey=d1000}}" Width="Auto"/>
                                </DataGrid.Columns>
                            </DataGrid  >
                        </Grid>
                    </Grid>
                    <Grid Grid.Row="1" Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="1*" />
                        </Grid.RowDefinitions>
                        <StackPanel   Grid.Column="0">
                            <WrapPanel>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0" Height="Auto"   Width="Auto"  Margin="20,0,0,0" Text="盘号:"  VerticalAlignment="Center" />
                                    <TextBlock  Grid.Column="1"   Background="LightCyan"  FontSize="18" Height="Auto"    Width="60"     Margin="15,0,0,0"  
                                   Text="{Binding Path=ABAAPOS, Source={StaticResource ResourceKey=vwMU}}" 
                                   VerticalAlignment="Center"  />
                                </Grid>
                                <Grid  Margin="20,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="盘数"  VerticalAlignment="Center"/>
                                    <TextBox Grid.Column="1" Background="White"  FontSize="18" Height="Auto"    Width="60" Name="txtBatches"   Margin="15,0,0,0" Text="0"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" FontSize="18" Width="20" Height="20" Margin="0,0,0,0"  Name="btnSaveBatch" Click="btnSaveBatch_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/save.png" />
                                        </Button.Background>
                                    </Button>
                                    <TextBlock Grid.Column="1" Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="分盘"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid Visibility="Collapsed">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock   Grid.Column="0"   Height="Auto"   Width="Auto"  Margin="20,0,0,0" Text="单成份量:"   VerticalAlignment="Center"/>
                                    <TextBox   Grid.Column="1" Background="White"  FontSize="18" Height="Auto"    Width="60" Name="txtLeftQty"   Margin="0,0,0,0" Text="{Binding ABARESMG, Converter={StaticResource ResourceKey=d1000}, Source={StaticResource ResourceKey=vwMU}}"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid Visibility="Collapsed">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button   Grid.Column="0"  FontSize="18" Width="30" Height="30" Margin="0,0,0,0"   Click="btnManualSetQty_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                                        </Button.Background>
                                    </Button>
                                    <TextBlock     Grid.Column="1"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="刷新"   VerticalAlignment="Center"/>
                                </Grid>
                            </WrapPanel>
                        </StackPanel>
                        <DataGrid Grid.Row="1"  Margin="0,0,0,0" 
                              FontSize="12"
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                              VerticalScrollBarVisibility="Auto"
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMU}}"  x:Name="dlgABA" 
                              >
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="批次" Binding="{Binding ABAAPOS,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                                <DataGridTextColumn Header="" Binding="{Binding ABAAUFKRS}" Width="Auto"/>
                                <DataGridTextColumn Header="分盘" Binding="{Binding ABAAUFLFD}" Width="Auto"/>
                                <DataGridTextColumn Header="" Binding="{Binding ABAAUFPOS}" Width="Auto"/>
                                <DataGridTextColumn Header="纱线" Binding="{Binding ABPART}" Width="Auto"/>
                                <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                                <DataGridTextColumn Header="盘量" Binding="{Binding ABASSTKGEW,Converter={StaticResource ResourceKey=d1000 }}" Width="Auto"/>
                                <DataGridTextColumn Header="盘数" Binding="{Binding ABASANZSTK}" Width="Auto"/>
                                <DataGridTextColumn Header="总重" Binding="{Binding ABARESMG,Converter={StaticResource ResourceKey=d1000 }}" Width="Auto"/>
                            </DataGrid.Columns>
                        </DataGrid  >
                    </Grid>
                    <TextBlock Grid.Column="0" Grid.ColumnSpan="3" 
                           HorizontalAlignment="Center" VerticalAlignment="Center" Name="txtMessage" Foreground="Red" Text="消息提醒" FontSize="18" ></TextBlock>
                </Grid>
            </Grid>
        </TabItem>
        <TabItem Header="制条需求" Name="MUREQ" IsEnabled="{Binding IsCanChgGAAUF,ElementName=TV}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="1*"/> 
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="350"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0" Grid.ColumnSpan="3" >
                    <WrapPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="20,0,0,0"   Click="btnListMUReq_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1"  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="查询制条"   VerticalAlignment="Center"/>
                        </Grid>
                        <Grid Margin="20,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"   Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="行类型"  VerticalAlignment="Center" />
                            <TextBox Grid.Column="1" Background="White" Height="Auto"    Width="Auto"   Margin="0,0,0,0" Name="txtKRSs" Text="HM"   VerticalAlignment="Center"/>
                        </Grid>
                        <TextBlock FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=原料}}"></TextBlock>
                        <TextBox FontSize="18" Name="txtART" VerticalAlignment="Center" Width="200"></TextBox>
                        <TextBlock FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=色号}}"></TextBlock>
                        <TextBox FontSize="18" Name="txtFARBE" VerticalAlignment="Center" Width="100"></TextBox>
                        <Button Width="Auto"  FontSize="18"  Margin="10,0,0,0"  HorizontalAlignment="Left" Click="btnFilter_Click"  Content="{Binding Source={Localization:TranslateExtension Word=过滤}}"></Button>
                        <Button Width="Auto"   FontSize="18"  Margin="10,0,0,0" HorizontalAlignment="Left" Click="btnFilterClear_Click" Content="{Binding Source={Localization:TranslateExtension Word=清除}}"></Button>
                        <Button Content="列表编辑" Click="GridEditCommand" Margin="10,0,0,0" />
                    </WrapPanel>
                    <StackPanel Grid.Row="0" Grid.Column="0">
                        <WrapPanel>
                            <Grid  Margin="0,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="总比列"  VerticalAlignment="Center" />
                                <TextBlock Grid.Column="1" Background="White"  FontSize="18" Height="Auto"    Width="40" Name="txtTRatio"   Margin="15,0,0,0" Text="0"   VerticalAlignment="Center"/>
                            </Grid>
                            <Grid  Margin="0,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="订单kg"  VerticalAlignment="Center"/>
                                <TextBlock  Grid.Column="1" Background="White"   Height="Auto"   Width="80"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                               Text="{Binding Path=ABPSOLLMENGE7, Source={StaticResource ResourceKey=vwTABPOS},Converter={StaticResource ResourceKey=d100}}" />
                            </Grid>

                            <Button   Height="Auto"   Width="Auto"  Margin="0,0,0,0" Content="投料比" IsEnabled="{Binding IsRatio,ElementName=TV}" VerticalAlignment="Center"  Click="btnAddRatio_Click"/>
                            <TextBox Name="txtAddRatio" Background="White"   Height="Auto"   Width="60"  Margin="10,0,0,0"  VerticalAlignment="Center"
                               Text="1"  />
                            <Button   Height="Auto"  Name="btnAddQty" Width="Auto"  Margin="0,0,0,0" Content="增加量"  VerticalAlignment="Center" Click="btnAddQty_Click"/>
                            <TextBox  Name="txtAddQty" Background="White"   Height="Auto"   Width="60"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                 Text="0" />
                        </WrapPanel>
                        <WrapPanel>
                            <WrapPanel>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="10,0,0,0"  Click="btnAddGAAUF_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                                        </Button.Background>
                                    </Button>
                                    <TextBlock Grid.Column="1"  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="插入"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="ID"  VerticalAlignment="Center" />
                                    <TextBlock Grid.Column="1" Background="White"   Height="Auto"    Width="20" Text="{Binding Path=GAPOS, Source={StaticResource ResourceKey=vwGAAUF}}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="MU"  VerticalAlignment="Center" />
                                    <TextBox TextChanged="TextBox_TextChanged" CharacterCasing="Upper" Grid.Column="1" Background="White"   Height="Auto" Width="40" Text="{Binding Path=GAAUFMSL, Source={StaticResource ResourceKey=vwGAAUF}}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="原料"  VerticalAlignment="Center" />
                                    <TextBox TextChanged="TextBox_TextChanged"  Grid.Column="1" Background="White" CharacterCasing="Upper"  Height="Auto"    Width="100" Text="{Binding Path=GAART, Source={StaticResource ResourceKey=vwGAAUF}}"  Margin="0,0,0,0"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="版本"  VerticalAlignment="Center" />
                                    <TextBox TextChanged="TextBox_TextChanged"  Grid.Column="1" Background="White" CharacterCasing="Upper"  Height="Auto"    Width="40" Text="{Binding Path=GAVAR, Source={StaticResource ResourceKey=vwGAAUF}}"  Margin="0,0,0,0"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto" Margin="0,0,0,0" Text="色号"  VerticalAlignment="Center" />
                                    <TextBox TextChanged="TextBox_TextChanged"  Grid.Column="1" Background="White" CharacterCasing="Upper"  Height="Auto"    Width="100" Text="{Binding Path=GAFARBE,Converter={StaticResource ResourceKey=gb2312}, Source={StaticResource ResourceKey=vwGAAUF}}"  Margin="0,0,0,0"   VerticalAlignment="Center"/>
                                </Grid>
                            </WrapPanel>
                            <WrapPanel>

                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="比例"  VerticalAlignment="Center" />
                                    <TextBox TextChanged="TextBox_TextChanged" Grid.Column="1" Background="White"   Height="Auto"    Width="80" Text="{Binding Path=GASP1,Converter={StaticResource ResourceKey=d1000},  Source={StaticResource ResourceKey=vwGAAUF}}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button  Grid.Column="0" Name="cCalculate" IsEnabled="{Binding IsCalculate,ElementName=TV}"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Content="计算"  VerticalAlignment="Center" Click="Calculate_Click" />
                                    <TextBlock Grid.Column="1" Background="White"   Height="Auto"    Width="80" Text="{Binding Path=GAKG1,Converter={StaticResource ResourceKey=d100},  Source={StaticResource ResourceKey=vwGAAUF}}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" Name="cSave" IsEnabled="{Binding IsSave,ElementName=TV}" FontSize="18" Width="30" Height="30" Margin="0,0,0,0"   Click="btnAdjustGAAUF_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/save.png" />
                                        </Button.Background>
                                    </Button>
                                    <TextBlock Grid.Column="1"  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="保存"   VerticalAlignment="Center"/>
                                </Grid>
                                <Grid  Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button FontSize="18" Width="30" Height="30" Margin="20,0,0,0"     Click="btnDelGAAUF_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/delete.png" />
                                        </Button.Background>
                                    </Button>
                                    <TextBlock Grid.Column="1"  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="删除"   VerticalAlignment="Center"/>
                                    <TextBox Grid.Column="2"  Background="White"   Height="Auto"    Width="Auto" Name="txtGADel"  Margin="0,0,0,0" Text="N"   VerticalAlignment="Center"/>
                                </Grid>
                                <Button   Height="Auto" Name="btnRepQty"  Width="Auto"  Margin="0,0,0,0" Content="回修+"  VerticalAlignment="Center" Click="btnRepQty_Click"/>
                                <TextBox   Background="White" Name="txtRepQty"  Height="Auto"   Width="60"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                 Text="0" />
                            </WrapPanel>
                        </WrapPanel>
                    </StackPanel>
                </StackPanel>
                <Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>

                    <Grid Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <DataGrid  Grid.Row="0" Grid.Column="0"
                    Margin="0,1,0,0.2"  Visibility="Collapsed"
                          FontSize="12" 
                          CanUserReorderColumns="True"  
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10"  
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwTABPOS}}" Grid.ColumnSpan="2"   
                  >
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="" Binding="{Binding ABPAUFKRS}" Width="Auto"/>
                                <DataGridTextColumn Header="生产单" Binding="{Binding ABPAUFLFD}" Width="Auto"/>
                                <DataGridTextColumn Header="" Binding="{Binding ABPAUFPOS}" Width="Auto"/>
                                <DataGridTextColumn Header="纱线" Binding="{Binding ABPART}" Width="Auto"/>
                                <DataGridTextColumn Header="版本" Binding="{Binding ABPVAR}" Width="Auto"/>
                                <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE}" Width="Auto"/>
                                <DataGridTextColumn Header="KG" Binding="{Binding Path=ABPSOLLMENGE5, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                                <DataGridTextColumn Header="开始" Binding="{Binding ABPSTARTDAT}" Width="Auto"/>
                                <DataGridTextColumn Header="交期" Binding="{Binding ABPENDDAT}" Width="Auto"/>
                                <DataGridTextColumn Header="行备注" Binding="{Binding REMARK, Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                            </DataGrid.Columns>
                        </DataGrid  >
                        <DataGrid  Grid.Row="1" Grid.Column="0"  FontSize="12" 
                               Name="dlgGAAUF"
                                   IsReadOnly="{Binding IsGridEdit,ElementName=TV,Converter={StaticResource not}}"
                                   CanUserReorderColumns="True"  
                                  CanUserResizeRows="True" 
                                   CanUserSortColumns="False"                  
                                   AutoGenerateColumns="False"    
                                   RowDetailsVisibilityMode="VisibleWhenSelected"  
                                   IsSynchronizedWithCurrentItem="True"   
                                   VerticalScrollBarVisibility="Auto" 
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwGAAUF}}">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="" Binding="{Binding GAAUFKRS}" Width="Auto"/>
                                <DataGridTextColumn Header="生产单" Binding="{Binding GAAUFLFD}" Width="Auto"/>
                                <DataGridTextColumn Header="" Binding="{Binding GAAUFPOS}" Width="Auto"/>
                                <DataGridTextColumn Header="ID" Binding="{Binding GAPOS}" Width="Auto"/>
                                <DataGridTextColumn Header="类型" Binding="{Binding GAAUFMSL,Converter={StaticResource ResourceKey=upper}}" Width="Auto"   />
                                <DataGridTextColumn Header="纱线" Binding="{Binding GAART, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                                <DataGridTextColumn Header="版本" Binding="{Binding GAVAR,Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                                <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/>
                                <DataGridTextColumn Header="批次" Binding="{Binding Path=GABEM, Converter={StaticResource ResourceKey=Trim}}" Width="Auto"/>
                                <DataGridTextColumn Header="比例" Binding="{Binding Path=GASP1, Converter={StaticResource ResourceKey=d1000}}" Width="Auto"/>
                                <DataGridTextColumn Header="需求" Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                                <DataGridTextColumn Header="预留" Binding="{Binding Path=GAKG2, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                                <DataGridTextColumn Header="总仓" Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                                <DataGridTextColumn Header="车间" Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                                <DataGridTextColumn Header="差异" Binding="{Binding Path=GAKG0, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="40"/>
                                <DataGridTextColumn Header="开始" Binding="{Binding GADATBIS}" Width="Auto"/>
                                <DataGridTextColumn Header="版本" Binding="{Binding GAURVAR}" Width="Auto"/>
                            </DataGrid.Columns>
                        </DataGrid>
                    </Grid>

                </Grid>
                <Grid Grid.Row="1" Grid.RowSpan="2" Grid.Column="1" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="3*"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="5*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Grid.Column="0" >
                            <WrapPanel>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="150"></ColumnDefinition>

                                    </Grid.ColumnDefinitions>
                                    <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="批次"  VerticalAlignment="Center" />
                                    <TextBox Grid.Column="1" Background="White"  Text="{Binding Path=GABEM,Converter={StaticResource ResourceKey=Trim},  Source={StaticResource ResourceKey=vwGAAUF}}"  Height="Auto"    Width="150"     Margin="0,0,0,0"   VerticalAlignment="Center"/>
                                </Grid>
                                <ComboBox Name="cmbLot" Width="100">
                                    <ComboBoxItem Content="纺批"></ComboBoxItem>
                                    <ComboBoxItem Content="染批"></ComboBoxItem>
                                </ComboBox>
                                <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="0,0,0,0" Name="btnMPlan"   Click="btnSaveGAAUF_Click">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                                    </Button.Background>
                                </Button>
                                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="预扣"  VerticalAlignment="Center" />

                            </WrapPanel>
                            <WrapPanel>
                                <TextBlock   Height="Auto"   Width="Auto"  Margin="20,0,0,0" Text="需求"  VerticalAlignment="Center" />
                                <TextBlock  Background="White"  Text="{Binding Path=GAKG1,Converter={StaticResource ResourceKey=d100},  Source={StaticResource ResourceKey=vwGAAUF}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
                                <TextBlock    Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="留位"  VerticalAlignment="Center" />
                                <TextBlock  Background="White"  Text="{Binding Path=GAKG3,Converter={StaticResource ResourceKey=d100},  Source={StaticResource ResourceKey=vwGAAUF}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
                                <TextBlock    Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="车间"  VerticalAlignment="Center" />
                                <TextBlock Grid.Column="1" Background="White"  Text="{Binding Path=GAKG5,Converter={StaticResource ResourceKey=d100},  Source={StaticResource ResourceKey=vwGAAUF}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
                                <TextBlock    Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="缺口"  VerticalAlignment="Center" />
                                <TextBlock Grid.Column="1" Background="White" Name="txtRestReq" Text="0"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="0,0,0,0" Name="btnBook"   Click="btnAllocate_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                                        </Button.Background>
                                    </Button>
                                    <TextBlock  Grid.Column="1"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="留位"  VerticalAlignment="Center" />
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="0,0,0,0" Name="btnRemoveBook"   Click="btnRemoveAllocate_Click">
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Delete.png" />
                                        </Button.Background>
                                    </Button>
                                    <TextBlock Grid.Column="1" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=取消}}"></TextBlock>
                                </Grid>
                            </WrapPanel>
                        </StackPanel>
                        <DataGrid  Grid.Row="1" Grid.Column="0"   
                                   FontSize="12" 
                                   CanUserReorderColumns="True"  
                                   CanUserResizeRows="True" CanUserSortColumns="True"       
                                   AutoGenerateColumns="False"   
                                           EnableRowVirtualization="True"  
                                           RowDetailsVisibilityMode="VisibleWhenSelected"   VerticalAlignment="Top"
                                           IsSynchronizedWithCurrentItem="True" VerticalScrollBarVisibility="Auto" Visibility="Visible"
                                           Name="dlgGLLG"
                                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwGLLG}}"   >
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="ID" Binding="{Binding GLLBEHI,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                                <DataGridTextColumn Header="P" Binding="{Binding LPLBKZ}" Width="Auto"/>
                                <DataGridTextColumn Header="LO" Binding="{Binding Path=GLLO}" Width="Auto"/>
                                <DataGridTextColumn Header="LB" Binding="{Binding Path=GLLB}" Width="Auto"/>
                                <DataGridTextColumn Header="LP" Binding="{Binding Path=GLLP}" Width="Auto"/>
                                <DataGridTextColumn Header="库存" Binding="{Binding Path=KG}" Width="Auto"/>
                                <DataGridTextColumn Header="留位" Binding="{Binding Path=ALLOKG}" Width="Auto"/>
                                <DataGridTextColumn Header="自由" Binding="{Binding Path=FREEKG}" Width="Auto"/>
                            </DataGrid.Columns>
                        </DataGrid  >
                    </Grid>

                    <Grid Grid.Row="2">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <WrapPanel Grid.Row="0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="库存"  VerticalAlignment="Center" />
                            </Grid>
                        </WrapPanel>
                        <DataGrid  Grid.Row="1" 
                              FontSize="12" 
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                                   VerticalScrollBarVisibility="Auto"
                              RowDetailsVisibilityMode="VisibleWhenSelected"   VerticalAlignment="Top"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                   Name="dlgYARNA"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwYARNA}}"   >
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="产地" Binding="{Binding GAVAR}" Width="Auto"/>
                                <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                                <DataGridTextColumn Header="纺批" Binding="{Binding GPSPPART,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                                <DataGridTextColumn Header="染批" Binding="{Binding GPFBPART,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                                <DataGridTextColumn Header="类型" Binding="{Binding GLAUFMSL}" Width="Auto"/>
                                <DataGridTextColumn Header="库" Binding="{Binding LO}" Width="Auto"/>
                                <DataGridTextColumn Header="区" Binding="{Binding LB}" Width="Auto"/>
                                <DataGridTextColumn Header="区" Binding="{Binding LP}" Width="Auto"/>
                                <DataGridTextColumn Header="库存" Binding="{Binding Path=NETKG}" Width="Auto"/>
                                <DataGridTextColumn Header="留位" Binding="{Binding Path=QLOCK}" Width="Auto"/>
                                <DataGridTextColumn Header="预扣" Binding="{Binding Path=QPLAN}" Width="Auto"/>
                                <DataGridTextColumn Header="自由" Binding="{Binding Path=QFREE}" Width="Auto"/>
                            </DataGrid.Columns>
                        </DataGrid  >
                    </Grid>

                </Grid>
                <Grid Grid.Row="2" Grid.Column="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <WrapPanel Grid.Row="0">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="需求"  VerticalAlignment="Center" />
                        </Grid>
                    </WrapPanel>
                    <DataGrid Grid.Row="1" Grid.Column="0" Margin="0,1,0,0"  
                              FontSize="12"
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                                  VerticalScrollBarVisibility="Auto"
                              RowDetailsVisibilityMode="VisibleWhenSelected"  VerticalAlignment="Top"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          Name="dlgMGAAUF"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwYGAAUF}}"   
                              >
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="类型" Binding="{Binding GAAUFMSL}" Width="Auto"/>
                            <DataGridTextColumn Header="品种" Binding="{Binding GAART}" Width="Auto"/>
                            <DataGridTextColumn Header="版本" Binding="{Binding GAVAR}" Width="Auto"/>
                            <DataGridTextColumn Header="说明" Binding="{Binding GSGARNBEZ,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                            <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                            <DataGridTextColumn Header="需求" Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                            <DataGridTextColumn Header="预留" Binding="{Binding Path=GAKG2, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                            <DataGridTextColumn Header="留位" Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                            <DataGridTextColumn Header="已接收" Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                            <DataGridTextColumn Header="差异" Binding="{Binding Path=GAKG0, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                            <DataGridTextColumn Header="开始" Binding="{Binding GADATBIS}" Width="Auto"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </Grid>
        </TabItem>
        <TabItem Header="合投" Name="tabCombine"   LostFocus="tabCombine_LostFocus" Visibility="Collapsed" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition   Height="Auto" />
                    <RowDefinition   Height="1*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
                    <WrapPanel>
                        <Button  Height="30"  Width="30" Margin="10,0,0,0"   IsEnabled="True" Click="btnRefresh_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Reload.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="刷新"></TextBlock>
                        <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnCombine_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=加入}}" ></TextBlock>
                        <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnCombineConvert_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Convert.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=合投}}" ></TextBlock>
                        <Grid Margin="20,0,0,0" Visibility="Collapsed">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="80"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=数量}}" ></TextBlock>
                            <TextBox  Grid.Column="1" Name="txtTQty" Text="0" ></TextBox>
                        </Grid>
                        <Grid Visibility="Collapsed">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="80"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=交期}}" ></TextBlock>
                            <TextBox  Grid.Column="1" Name="txtDD" Text="0" ></TextBox>
                        </Grid>
                        <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnRemoveFromCombine_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  Text="{Binding Source={Localization:Translate Word=移除}}" ></TextBlock>
                    </WrapPanel>
                </StackPanel>
                <DataGrid  Grid.Row="1" Grid.Column="0"
                        FontSize="12" 
                        Name="dlgABAX"
                        AutoGenerateColumns="False" 
                        EnableRowVirtualization="True" 
                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwXABPOS}}" 
                        HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto"  EnableColumnVirtualization="True" 
                        HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                    <DataGrid.Columns>

                        <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}"    Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS}"   Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE5, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:TranslateExtension Word=KG}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=品种}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto"></DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
                <DataGrid  Grid.Row="1" Grid.Column="1"
                        FontSize="12" 
                        Name="dlgTABAX"
                        AutoGenerateColumns="False" 
                        EnableRowVirtualization="True" 
                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwTABPOS}}" 
                        HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto"   EnableColumnVirtualization="True" 
                        HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                    <DataGrid.Columns>

                        <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}"    Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS}"   Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE5, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:TranslateExtension Word=KG}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=品种}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto"></DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
        </TabItem>
        <TabItem Header="复板原料转换">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition   Height="Auto" />
                    <RowDefinition   Height="1*" />
                </Grid.RowDefinitions>
                <GD:TGDEXG dwReq="{Binding dwAB,ElementName=TV}"
                           Grid.Row="1"
                             IsAuto="True"
                           />
            </Grid>
        </TabItem>
        <TabItem Header="留位明细" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <WrapPanel Grid.Row="0" Grid.Column="0">
                    <TextBlock Text="留位"></TextBlock>
                </WrapPanel>
                <DataGrid  Grid.Row="1" Grid.Column="0"
                                           FontSize="12" 
                                           CanUserReorderColumns="True"  
                                           CanUserResizeRows="True" CanUserSortColumns="True"                  
                                           AutoGenerateColumns="False"   
                                           EnableRowVirtualization="True"  
                                           RowDetailsVisibilityMode="VisibleWhenSelected"  VerticalAlignment="Top"
                                           IsSynchronizedWithCurrentItem="True" VerticalScrollBarVisibility="Auto" Visibility="Visible" 
                                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwXZUTEI}}"   >
                    <DataGrid.Columns>
                        <DataGridTextColumn   Binding="{Binding ZUAUFKRS}" Width="Auto"/>
                        <DataGridTextColumn Header="生产单" Binding="{Binding ZUAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"  />
                        <DataGridTextColumn Binding="{Binding ZUAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                        <DataGridTextColumn Header="留位" Binding="{Binding Path=QLOCK}" Width="Auto"/>
                        <DataGridTextColumn Header="车间" Binding="{Binding Path=QISSUE}" Width="Auto"/>
                        <DataGridTextColumn Header="自由" Binding="{Binding Path=FREEKG}" Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
                <WrapPanel Grid.Row="0" Grid.Column="1">
                    <TextBlock Text="预扣"></TextBlock>
                </WrapPanel>
                <DataGrid  Grid.Row="1" Grid.Column="1"
                                           FontSize="12" 
                                           CanUserReorderColumns="True"  
                                           CanUserResizeRows="True" CanUserSortColumns="True"                  
                                           AutoGenerateColumns="False"   
                                           EnableRowVirtualization="True"  
                                           RowDetailsVisibilityMode="VisibleWhenSelected"   VerticalAlignment="Top"
                                           IsSynchronizedWithCurrentItem="True"   Visibility="Visible" 
                                   VerticalScrollBarVisibility="Auto"
                                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwXGAAUF}}"   >
                    <DataGrid.Columns>
                        <DataGridTextColumn   Binding="{Binding GAAUFKRS}" Width="Auto"/>
                        <DataGridTextColumn Header="生产单" Binding="{Binding GAAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"  />
                        <DataGridTextColumn Binding="{Binding GAAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                        <DataGridTextColumn Header="预扣" Binding="{Binding Path=QPLAN}" Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
            </Grid>
        </TabItem>

    </TabControl>
</local:DocumentBase>
